#!/usr/bin/python
# -*- coding: UTF-8 -*-

class datafilter(object):
    def __init__(self):
        pass


    def split_deal(self,str):
        result = 0
        if str != '':
            result = int(str)
        return result

    def split_price(self,str):
        result = 0.0
        if str != '':
            result = float(str.split()[1])
        return result

    # 去除数据
    def dropnull(self,data):
        data["price"] = data["price"].apply(self.split_price)
        data["deal"] = data["deal"].apply(self.split_deal)
        return data